package com.sample;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service;

import java.util.concurrent.Future;

/**
 * Created by leo.na on 21/03/2017.
 */
@Service
public class KresnaApiApplicationBootstrap {

    private static final Logger log = LoggerFactory.getLogger(KresnaApiApplicationBootstrap.class);

    @Async
    public Future<Void> run() {
        try {
            log.info("Running API bootstrap");
            // do app bootstrap here

        } catch (Throwable e) {
            log.error("API run failed", e);
        }
        return new AsyncResult<>(null);
    }

}
